<template>
  <div>
    <!-- 当foor有follow的时候就自调用 -->
    <foor v-if="post.parent" :post="post.parent"></foor>

    <div class="floorWrapper">
      <div class="meta">
        <div class="info">
          {{post.account.nickname}}
          <span class="time">{{post.account.updated_at|time}}</span>
        </div>
        <div class="btnReply" @click="huifu">回复</div>
      </div>

      <div class="loucengneirong">{{post.content}}</div>
    </div>
  </div>
</template>

<script>
import moment from "moment";
export default {
  name: "foor",
  props: ["post"],
  filters: {
    time(val) {
      return moment(val).format("YYYY-MM-DD hh:mm");
    }
  },
  methods: {
    huifu() {
      this.$axios({
        url: "/comments",
        method: "post",
        data: {
          post: id,
          pics: this.pics,
          content: this.textarea
        },
        headers: {
          Authorization: "Bearer " + this.$store.state.user.userInfo.token,
          "Content-Type": "application/json"
        }
      }).then(res=>{
          
          
      })
    }
  }
};
</script>

<style lang="less" scoped>
.floorWrapper {
  border: 1px solid #cccccc;
  background-color: #eee;
  padding: 0 10px;
  .meta {
    display: flex;
    justify-content: space-between;
    align-content: center;
    .time {
      font-size: 16px;
      color: #888;
    }
    .btnReply {
      font-size: 14px;
      color: #888;
    }
  }

  .loucengneirong {
    margin: 10px 0;
  }
}
</style>